library(dplyr)
library(magrittr)
library(tidyr)
library(ggplot2)

dat <- rio::import("data/Demo_book_country_3.dta")

p <- dat %>%
  filter(year == 2000, duration_global < 600) %>%
  ggplot(aes(x = eur_pct_est_smooth, y = duration_global)) +
  geom_point() +
  labs(y = "Colonial Duration (years)", x = "European Ancestry (%)") +
  theme(panel.grid.minor = element_blank(),
        panel.background = element_blank(),
        panel.grid.major = element_blank(),
        panel.border = element_blank(),
        axis.line = element_line(color = "black"),
        plot.margin = margin(1, 1, 1, 0.25, "cm"))
# p

## ggsave(p, file = "figure_9_5.png",
##        width = 11, height = 8.5)

ggsave(p, file = "output/figure_9_3.tiff",
       width = 11, height = 8.5, dpi = 300)
